import { CtrlType } from "./ctrl-type";

/**
 * @description Luckysheet部件接口
 * @export
 * @interface ISheetCtrl
 */
export interface ISheetCtrl {
  /**
   * @description 部件id
   * @type {string}
   * @memberof ISheetCtrl
   */
  id: string;

  /**
   * @description 部件name
   * @type {string}
   * @memberof ISheetCtrl
   */
  name: string;

  /**
   * @description 部件codeName
   * @type {string}
   * @memberof ISheetCtrl
   */
  codeName: string;

  /**
   * @description 部件类型
   * @type {('GRID' | 'FORM' | 'CTRL')}
   * @memberof ISheetCtrl
   */
  type: CtrlType.VISUAL_GRID | CtrlType.VISUAL_FORM | CtrlType.CTRL;
  
  /**
   * @description 定位[left：左侧距离，top：上方距离，width：宽度，height：number]
   * @type {{ left: number, top: number, width: number, height: number }}
   * @memberof ISheetCtrl
   */
  position?: {
    left?: number,
    top?: number,
    width?: number,
    height?: number,
    row?: number,
    col?: number,
    startRow?: number,
    startCol?: number
  };

  /**
   * @description 类型为GRID时，标识显示表格列
   * @type {string[]}
   * @memberof ISheetCtrl
   */
  columns?: string[];

  /**
   * @description 工作簿配置
   * @type {*}
   * @memberof ISheetCtrl
   */
  workBookConfig?: any;

  /**
   * @description 工作表配置
   * @type {*}
   * @memberof ISheetCtrl
   */
  sheetConfig?: any;

  /**
   * @description 表单项集合
   * @type {any[]}
   * @memberof ISheetCtrl
   */
  items?: any[];
}